package com.lab.app.customui;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by ak
 */
public class CustomUiUpdateParam {

    private List<IUpdateParam> mUpdateParamList;

    public CustomUiUpdateParam(List<IUpdateParam> updateParamList) {
        mUpdateParamList = updateParamList;
    }

    public List<IUpdateParam> getUpdateParamList() {
        return mUpdateParamList;
    }

    public static class Builder {

        private List<IUpdateParam> mUpdateParamList;

        public Builder addParam(IUpdateParam param) {
            if (null != param) {
                ensureList();
                if (!mUpdateParamList.contains(param))
                    mUpdateParamList.add(param);
            }
            return this;
        }

        public CustomUiUpdateParam build() {
            return new CustomUiUpdateParam(mUpdateParamList);
        }

        private void ensureList() {
            if (null == mUpdateParamList)
                mUpdateParamList = new ArrayList<IUpdateParam>();
        }

    }

    public interface IUpdateParam {
    }

    public static class Title implements IUpdateParam {
        public String name;

        public Title() {

        }

        public Title(String name) {
            this.name = name;
        }
    }

    public static class SubTitle implements IUpdateParam {
        public String name;

        public SubTitle() {

        }

        public SubTitle(String name) {
            this.name = name;
        }
    }

    public static class LeftArea implements IUpdateParam {
        public String name;

        public LeftArea() {

        }

        public LeftArea(String name) {
            this.name = name;
        }
    }

    public static class RightArea implements IUpdateParam {
        public String name;

        public RightArea() {

        }

        public RightArea(String name) {
            this.name = name;
        }
    }

    public static class LeftAreaDrawable implements IUpdateParam {
        public int drawableId;
        public boolean drawableLeft = true;

        public LeftAreaDrawable() {

        }

        public LeftAreaDrawable(int drawableId, boolean drawableLeft) {
            this.drawableId = drawableId;
            this.drawableLeft = drawableLeft;
        }
    }

    public static class RightAreaDrawable implements IUpdateParam {
        public int drawableId;
        public boolean drawableLeft = true;

        public RightAreaDrawable() {

        }

        public RightAreaDrawable(int drawableId, boolean drawableLeft) {
            this.drawableId = drawableId;
            this.drawableLeft = drawableLeft;
        }
    }

}
